package com.sc.nft.dao;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.ActivityTask;
import com.sc.nft.enums.task.ActivityTaskTypeEnum;
import com.sc.nft.mapper.ActivityTaskMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;


@Slf4j
@Repository
public class ActivityTaskDao extends ServiceImpl<ActivityTaskMapper, ActivityTask> {

    /**
     * 查询进行中的任务
     * @param type
     * @param collectionId
     * @return
     */
    public List<ActivityTask> goingTask(ActivityTaskTypeEnum type,   Long collectionId){
        return baseMapper.goingTask(type.getCode(),collectionId);
    }

    /**
     * 根据活动查询任务
     * @param activityId
     * @return
     */
    public List<ActivityTask> getTaskByActivityId(  Long activityId){
        return baseMapper.getTaskByActivityId(activityId);
    }
}